pkgname=lmbench
pkgver=3.0
pkgrel=0
pkgdesc="A suite of simple, portable, ANSI/C microbenchmarks for UNIX/POSIX, measures latency and bandwidth."
arch=('i386' 'x86_64' 'riscv64')
url="http://www.bitmover.com/lmbench/"
license=('GPL')
makedepends_debian_11=(libtirpc-dev)
source=("https://gitee.com/rtoax/lmbench.git")
md5sums=('SKIP')

build() {
	cd "$srcdir/$pkgname"
	[ $(uname -m) = "aarch64" ] && sed -i 's/arm\*/aarch64\*/g' ./scripts/gnu-os
	sed -i '/LDLIBS=-lm/a LDLIBS="${LDLIBS} -ltirpc"\nCFLAGS="${CFLAGS} -I/usr/include/tirpc"' ./scripts/build
	make OS=`uname -m` -j
}

package() {
	mkdir -p "$pkgdir/lkp/benchmarks/lmbench3"
	cp -r "$srcdir/$pkgname/"* "$pkgdir/lkp/benchmarks/lmbench3"
}
